In 1890, London's prostitutes are being killed with swords in a series of unsolved murders by "The Muttonchop Murderer". Scotland Yard's Inspector Wiggum challenges master detective Eliza Simpson and her easily amazed, goofy assistant Dr. Bartley to solve the crime. Their first piece of evidence is a bloody sword found by a "proper-Cockney flower girl", Marge. Simpson takes the sword to an oddities merchant (Comic Book Guy), who recognizes the sword as part of a set he had sold, called The Seven Swords of Osiris. He goes to check his dusty record books to see who he sold the swords to, but is murdered by the killer. Looking at the ledger, Simpson and Bartley discover the swords were sold to C. Ebenezer Burns, an industrialist who "makes coal out of babies".
Bartley knows where to find Burns and tracks him down at Mao's Den of Inequity, an opium den. Burns instantly recognizes the sword, and tells Simpson that he sold them for opium to a "fat man with sideburns", and notices a man nearby who resembles the description, Homer. Simpson and Bartley chase him down and Homer gets caught by Wiggum, who happens to be at the opium den as well, to help his son Ralph go to sleep.
Simpson and Bartley congratulate themselves for solving the crime, until they find another body, Selma, stabbed by another Sword of Osiris. Bartley first dismisses the body as having been killed days prior, pointing out the body as bloated and the face rotten, though Selma is alive long enough to say it was just "5 minutes ago". Simpson takes the sword and recognizes a certain scent on the sword handle. The next day, just before Homer is hanged for the murders, Simpson arrives, declaring Homer innocent due to the smell of eel pie on the handle, which Wiggum loves to eat.
Officer Lou then reveals that Wiggum has muttonchops as well, exposing him as the killer. He starts to explain that he just wanted to come up with a case that Simpson herself could not solve, but then flees in a hot-air balloon stolen from Professor Frink, but it gets pierced by a steampunk-style flying saucer flown by Kang and Kodos, who consider Earth's air fleet as destroyed. It is then shown that the whole story was an opium-caused dream by Ralph, which Wiggum reveals is part of an even crazier and fantastical dream that both of them are in.